# user=[
#     {'name':'tom','age':18,'hobbies':['sing','play']},
#     {'name':'rose','age':88,'hobbies':['read','sleep']},
#     {'name':'jack','age':99,'hobbies':['swim','watchTV','talk']},
# ]
# # 取第3个学生的第2个爱好watchTV
# print(user[2]['hobbies'][1])

# # 将字符串name='tom say hello world,tom say bye'替换成rose say hello world,tom say bye
# name='tom say hello world,tom say bye'
# list_str = name.split(" ")
# del list_str[0]
# list_str.insert(0,"rose")
# print("".join(list_str))
# result = 0
# for i in range(1, 101):
# 	if i % 2 == 0:
# 		result += i
# print(result)

# info={
# 'egon':{'pwd':'123','hobbies':['play','music','read']},
# 'alex':{'pwd':'1234','hobbies':['music','read']},
# 'wupeiqi':{'pwd':'135','hobbies':['read',]},
# }
#
#
# print(id(info))
# print(id(info['alex']['hobbies']))
# info['alex']['hobbies'].append('play')  # 给alex追加play的爱好
# print(id(info))
# print(id(info['alex']['hobbies']))

# li = ['周','周星星','麻花藤','周扒皮']  #删除姓周的名后返回li列表
# num = len(li)
# for item in range(num-1 ,-1,-1):
# 	print("{}{}".format(item,num))
# 	if li[item].startswith("周"):
# 		li.remove(li[item])
# 	num -= 1
# print(li)

#### 输入一年份，判断该年份是否是闰年并输出结果。（编程题）
# 注：凡符合下面两个条件之一的年份是闰年。 （1） 能被4整除但不能被100整除。 （2） 能被400整除。

# year = input("请输入年份:").strip()
# if year.isdecimal():
# 	if int(year) % 4 == 0 and int(year) % 100 != 0 or int(year) % 400 == 0:
# 		print("是闰年")
# 	else:
# 		print("不是闰年")
# else:
# 	print("数据错误")

# 使用while循环/for循环实现输出2-3+4-5+6…+100的和
# num = 2
all1 = 0
# all2 = 0
result = 0
# while num<101:
# 	if num % 2 == 0:
# 		all1 += num
# 	else:
# 		all1 -= num
# 	num += 1
# print(all1)

# for item in range(2,101):
# 	if item % 2 ==0:
# 		all1 += item
# 	else:
# 		all1 -= item
# print(all1)

# 九九乘法
# for i in range(1, 10):
# 	for j in range(1, 10):  # i+1
# 		if i >= j:
# 			print("{}*{}={}".format(i, j, i * j), end=" ")
# 	print()

# li = ["hello", 'seven', ["mon", ["h", "eric"], 'all'], 123, 446]

# - 请根据索引输出“eric”
# - 请使用索引找到'all'元素并将其修改为“ALL”，如：li[0][1][9]...
# print(li[2][1][1])
# print(li[2][2].upper())
"""
upper()
strip()
lstrip()
rstrip()
lower()
split()
replace()
title()
join()
isDecimal()
"""

